#pragma once
#include "C_Widget.h"
#include "C_Label.h"

namespace gui
{
	class C_List;

	class C_ListItem :
		public C_Widget
	{
	private:
		C_Label m_label;
		void*   m_data;
		C_List* m_list;
		bool m_selected;

	public:
		C_ListItem(std::wstring t, void* data);
		C_ListItem();
		virtual ~C_ListItem();

		void	setText		(std::wstring t)	{ m_label.setText(t);		 }
		void	setTextSize	(int size)			{ m_label.setTextSize(size); }
		void	setData(void* data)				{ m_data = data; }
		void*	data()							{ return m_data; }
		void	setList(C_List* list);
		void	setSelect(bool s)	{ m_selected = s;	 }
		bool	isSelected()		{ return m_selected; }

		/////////////////////////////////////////////////////////////////////////////////
		/////////////////	VIRTUAL FUNCTION
		virtual void renderWidget();
		virtual void syncWidgets();
	};
}

